<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('teamsetting',$postdata);
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('teamsetting');
	$return['item']['jy_pinggou']=$this->plugin_exists('jy_pinggou')?1:0;
	$return['item']['footernav'] = !empty($return['item']['footernav']) ? $return['item']['footernav'] : $footernav;
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基础设置',
				'list'=>array(
					array('type'=>'switch','title'=>'开启门店建仓级差分红模式','name'=>'isopen'),
					array('type'=>'radio','title'=>'前端门店显示层级','name'=>'level','options'=>'level'),
					array('type'=>'radio','title'=>'成为默认等级条件','name'=>'become','options'=>'become'),
					array('type'=>'unitstring','unit'=>'元','title'=>'单笔自购金额','name'=>'oneorder_price','show'=>array('become'=>3)),
					array('type'=>'unitstring','unit'=>'元','title'=>'自购订单总金额','name'=>'buyallfee','show'=>array('become'=>4)),
					array('type'=>'choose_many','title'=>'购买指定商品升级','name'=>'goods_ids','action'=>'jy_weishop/goods.get_goods/many/','choose_title'=>'选择参与的商品','show'=>array('become'=>5)),
					array('type'=>'checkbox','title'=>'门店升级要求','name'=>'level_up_types','options'=>'leveltype','help'=>'《推荐次等级个数》：是指推荐了次等级的团个数，比如等级分为，A,B,C,D,E。A是预选团长，E是最高团长。我现在是C等级，想上级D等级，需要我的下级里面有C等级**个'),
					array('type'=>'switch','title'=>'开启最大团队长平级分红?','name'=>'open_maxteamfee','help'=>'说明：以《推荐次等级个数》说明：是指推荐了次等级的团个数，比如等级分为，A,B,C,D,E，F。A是预选团长，E是最大团队长，F也是最大团队长，推荐关系是E推荐F；</br>
					如果开启最大团队长平级分红，那么E团队长能拿F团队长整个团队名下分销订单总分红；</br>
					如果不开启最大团队长平级分红，那么E团队长就不能拿F团队长整个团队名下订单总分红；</br>
					'),
					array('type'=>'unitstring','unit'=>'%','title'=>'最大团队长平级分红%','name'=>'maxteamfee_rate','show'=>array('open_maxteamfee'=>1),'help'=>'说明：只能填写数字；'),
					array('type'=>'switch','title'=>'是否需要审核','name'=>'isshenhe'),
					array('type'=>'switch','title'=>'是否需要完善资料','name'=>'isinfo'),
					array('type'=>'switch','title'=>'关闭转账功能？','name'=>'isno_zhuan','help'=>''),
					array('type'=>'string','title'=>'门店分享二维码说明','name'=>'share_help'),
					array('type'=>'string','title'=>'门店分享标题','name'=>'teamshare_title'),
					array('type'=>'string','title'=>'门店分享描述','name'=>'teamshare_desc'),
					array('type'=>'richtext','title'=>'门店须知','name'=>'team_xieyi'),
				)
			),
		)
	);
	$return['team_tiaojians']=$this->team_tiaojians;
	$return['leveltype']=$this->level_up_types;
	$return['become']=array('0'=>'无条件','1'=>'后台指定','2'=>'提交申请','3'=>'单笔自购金额','4'=>'自购订单总金额','5'=>'指定购买商品');
	$return['level']=$this->level_types;
	$return['htmls']=$htmls;
	exi($return);
}


